package com.csdnn;

import java.sql.SQLOutput;

public class Test1 {
    public static void main(String[] args) {
        GirlFriend GF=GirlFriend.getInstance();
        System.out.println(GF);
    }
}

class GirlFriend{
    private String name;
    private static GirlFriend gf=new GirlFriend("紫霞仙子");
    private GirlFriend(String name){
        this.name=name;
    }
    public static GirlFriend getInstance(){
        return gf;
    }

    @Override
    public String toString() {
        return "GirlFriend{" +
                "name='" + name + '\'' +
                '}';
    }
}
